<?php
	function tree_get_childs($params){
		$mas = array();
		foreach ($params['array'] as $value){
			if ($value['parent']['id'] == $params['id'] || $value['parent'] == $params['id']) {
				array_push($mas, $value);
			} 
		}
		return $mas;
	}
	
	function set_childs_pos($page, $act, $id){
		global $treeclass, $smarty;
		$treeclass->treepos($act, $id);
		$tree_types = $treeclass->gettreetypes('tree');
		$treeclass->maketree(0, $_SESSION['lang'], $tree_types);
		$dat = tree_get_childs(array('id'=>$page, 'array'=>$treeclass->mas));
		$smarty->assign("child_list", $dat);
		$str = $smarty->fetch('admin/body/childlist/list.html');	
		$objResponse = new xajaxResponse();
		$objResponse->addAssign("childs_id", "innerHTML", $str);
		return $objResponse;
	}
?>
